/*
 * @Author: your name
 * @Date: 2022-04-18 15:21:34
 * @LastEditTime: 2022-05-10 10:42:25
 * @LastEditors: 飞越疯人院 353362604@qq.com
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \forge-001\public\toolbarExtension.js
 */

const { Autodesk } = window
export default function ToolbarExtension(viewer, options) {
    Autodesk.Viewing.Extension.call(this, viewer, options)
}
ToolbarExtension.prototype = Object.create(Autodesk.Viewing.Extension.prototype)
ToolbarExtension.prototype.constructor = ToolbarExtension
ToolbarExtension.prototype.load = function () {
    this.viewer.setLightPreset(5)
    this.viewer.setEnvMapBackground(false)
    this.viewer.fitToView()
    return true
}
ToolbarExtension.prototype.unload = function () {
    // nothing yet
    console.log('ToolbarExtension')
}

Autodesk.Viewing.theExtensionManager.registerExtension('ToolbarExtension', ToolbarExtension)
